package com.wzy.designpattern.creational.prototype;

/**
 * 描述
 * 创建人    Wzy
 * 创建时间: 2020-05-15  20:07
 */
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Mail mail = new Mail();
        mail.setContent("初始化模板");
        for (int i = 0; i < 10; i++) {
            Mail mailTemp = (Mail) mail.clone();
            mail.setName("姓名" + i);
            mail.setEmailAddress("姓名" + i + "@qq.com");
            mail.setContent("恭喜此次活动中奖");
            MailUtil.sendMail(mail);
        }
        MailUtil.saveOriginMailRecord(mail);
    }
}
